home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / visulztn / saoimage / saoimage.lha / vms / make.com < prev    next >
Text File  |  1990-05-12  |  2KB  |  95 lines

  1. $!-------------------------------------------------------------------------
  2. $!
  3. $! MAKE.COM - Build SAOimage VMS library
  4. $!
  5. $!    Parameters:
  6. $!        P1    null    Compile and update all sources
  7. $!            xxx    Source module - compile and update library
  8. $!        P2    options    CC compiler options
  9. $!
  10. $!-------------------------------------------------------------------------
  11. $
  12. $
  13. $ gosub BUILD_SETUP
  14. $
  15. $ if p1 .eqs. ""     then goto BUILD_ALL
  16. $
  17. $ gosub COMPILE_MODULE
  18. $ exit
  19. $
  20. $
  21. $BUILD_SETUP:
  22. $
  23. $ set noon
  24. $
  25. $ if f$logical("IRAFLIBC") .eqs. "" then iraf
  26. $
  27. $ compile := cc/define=(nodebug)/debug/optimize
  28. $ libname := libvms.olb
  29. $ makefile:= make.lst
  30. $
  31. $ return
  32. $
  33. $
  34. $COMPILE_MODULE:
  35. $
  36. $ p1 = p1 - ".C"
  37. $
  38. $ compile 'p1' 'p2' 'make_options'
  39. $ library/log 'libname' 'p1'
  40. $
  41. $ return
  42. $
  43. $
  44. $BUILD_ALL:
  45. $
  46. $ if f$search(libname) .eqs. "" then library/create 'libname'
  47. $
  48. $ open/read make_input 'makefile'
  49. $
  50. $ReadLoop:
  51. $ read/end=ReadEOF/err=CLEANUP make_input line
  52. $ first = f$extract(0,1,line)
  53. $ if first .nes. "!" .and. first .nes. "#"
  54. $ then
  55. $    make_options = f$extract(f$locate("/",line),f$length(line),line)
  56. $
  57. $    p1  = f$edit(line,"UPCASE") - ".C" - make_options
  58. $    p1s = p1 + ".C"
  59. $    p1o = p1 + ".OBJ"
  60. $    if f$search(p1s) .eqs. ""
  61. $    then
  62. $        write sys$output p1s + " not found!"
  63. $        goto ReadLoop
  64. $    endif
  65. $    if f$search(p1o) .eqs. "" then goto Recompile
  66. $
  67. $    srcdate = f$file_attributes(p1s,"RDT")
  68. $    objdate = f$file_attributes(p1o,"RDT")
  69. $    bin_srcdate = f$cvtime(srcdate)
  70. $    bin_objdate = f$cvtime(objdate)
  71. $
  72. $    if bin_srcdate .les. bin_objdate
  73. $    then
  74. $        write sys$output "Up-to-date... " + p1
  75. $        goto ReadLoop
  76. $    endif
  77. $Recompile:
  78. $    write sys$output "Compiling... " + p1
  79. $ p1 = p1 - ".C"
  80. $
  81. $ compile 'p1' 'p2' 'make_options'
  82. $ library/log 'libname' 'p1'
  83. $
  84. $ endif
  85. $ goto ReadLoop
  86. $
  87. $ReadEOF:
  88. $ close make_input
  89. $ exit
  90. $
  91. $
  92. $CLEANUP:
  93. $ if f$logical("MAKE_INPUT") .nes. "" then close make_input
  94. $ exit
  95.